package com.hwbsite.hwbback.controller;


import com.hwbsite.hwbback.entity.UserDTO;
import com.hwbsite.hwbback.service.AuthService;
import com.hwbsite.hwbback.utils.TokenRes;
import jakarta.servlet.http.HttpServletResponse;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("auth")
public class AuthController {

    @Autowired
    private AuthService authService;


    @PostMapping("token")
    public TokenRes login(@RequestBody UserDTO dto, HttpServletResponse response){
        return authService.token(dto, response);
    }
}
